GdkDevice *logical_device;
GdkDevice *stylus_device;
- GdkDevice *eraser_device;
- GdkDevice *current_device;
GdkSeat *seat;
GdkWaylandPointerData pointer_info;
GdkWaylandTabletData *tablet = l->data;
if (tablet->logical_device == device ||
- tablet->stylus_device == device ||
- tablet->eraser_device == device)
+ tablet->stylus_device == device)
return tablet;
}
0, 0, 1, 0);
}
-static GdkDevice *
-tablet_select_device_for_tool (GdkWaylandTabletData *tablet,
- GdkDeviceTool *tool)
-{
- GdkDevice *device;
-
- if (gdk_device_tool_get_tool_type (tool) == GDK_DEVICE_TOOL_TYPE_ERASER)
- device = tablet->eraser_device;
- else
- device = tablet->stylus_device;
-
- return device;
-}
-
static void
_gdk_wayland_seat_remove_tool (GdkWaylandSeat *seat,
GdkWaylandTabletToolData *tool)
seat->tablets = g_list_remove (seat->tablets, tablet);
gdk_seat_device_removed (GDK_SEAT (seat), tablet->stylus_device);
- gdk_seat_device_removed (GDK_SEAT (seat), tablet->eraser_device);
gdk_seat_device_removed (GDK_SEAT (seat), tablet->logical_device);
while (tablet->pads)
_gdk_device_set_associated_device (tablet->logical_device, NULL);
_gdk_device_set_associated_device (tablet->stylus_device, NULL);
- _gdk_device_set_associated_device (tablet->eraser_device, NULL);
if (tablet->pointer_info.focus)
g_object_unref (tablet->pointer_info.focus);
wl_surface_destroy (tablet->pointer_info.pointer_surface);
g_object_unref (tablet->logical_device);
g_object_unref (tablet->stylus_device);
- g_object_unref (tablet->eraser_device);
g_free (tablet);
}
GdkWaylandTabletData *tablet = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
GdkDisplay *display = gdk_seat_get_display (GDK_SEAT (seat));
- GdkDevice *logical_device, *stylus_device, *eraser_device;
- gchar *logical_name, *eraser_name;
+ GdkDevice *logical_device, *stylus_device;
+ gchar *logical_name;
gchar *vid, *pid;
vid = g_strdup_printf ("%.4x", tablet->vid);
NULL);
GDK_WAYLAND_DEVICE (logical_device)->pointer = &tablet->pointer_info;
- eraser_name = g_strconcat (tablet->name, " (Eraser)", NULL);
-
stylus_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
"name", tablet->name,
"type", GDK_DEVICE_TYPE_PHYSICAL,
"product-id", pid,
NULL);
- eraser_device = g_object_new (GDK_TYPE_WAYLAND_DEVICE,
- "name", eraser_name,
- "type", GDK_DEVICE_TYPE_PHYSICAL,
- "source", GDK_SOURCE_ERASER,
- "has-cursor", FALSE,
- "display", display,
- "seat", seat,
- "vendor-id", vid,
- "product-id", pid,
- NULL);
-
tablet->logical_device = logical_device;
init_pointer_data (&tablet->pointer_info, display, tablet->logical_device);
tablet->stylus_device = stylus_device;
- tablet->eraser_device = eraser_device;
_gdk_device_set_associated_device (logical_device, seat->logical_keyboard);
_gdk_device_set_associated_device (stylus_device, logical_device);
- _gdk_device_set_associated_device (eraser_device, logical_device);
gdk_seat_device_added (GDK_SEAT (seat), logical_device);
gdk_seat_device_added (GDK_SEAT (seat), stylus_device);
- gdk_seat_device_added (GDK_SEAT (seat), eraser_device);
- g_free (eraser_name);
g_free (logical_name);
g_free (vid);
g_free (pid);
{
gint axis_pos;
- g_object_freeze_notify (G_OBJECT (tablet->current_device));
- _gdk_device_reset_axes (tablet->current_device);
+ g_object_freeze_notify (G_OBJECT (tablet->stylus_device));
+ _gdk_device_reset_axes (tablet->stylus_device);
- _gdk_device_add_axis (tablet->current_device, GDK_AXIS_X, 0, 0, 0);
- _gdk_device_add_axis (tablet->current_device, GDK_AXIS_Y, 0, 0, 0);
+ _gdk_device_add_axis (tablet->stylus_device, GDK_AXIS_X, 0, 0, 0);
+ _gdk_device_add_axis (tablet->stylus_device, GDK_AXIS_Y, 0, 0, 0);
if (tool->tool_axes & (GDK_AXIS_FLAG_XTILT | GDK_AXIS_FLAG_YTILT))
{
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_XTILT, -90, 90, 0);
tablet->axis_indices[GDK_AXIS_XTILT] = axis_pos;
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_YTILT, -90, 90, 0);
tablet->axis_indices[GDK_AXIS_YTILT] = axis_pos;
}
if (tool->tool_axes & GDK_AXIS_FLAG_DISTANCE)
{
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_DISTANCE, 0, 65535, 0);
tablet->axis_indices[GDK_AXIS_DISTANCE] = axis_pos;
}
if (tool->tool_axes & GDK_AXIS_FLAG_PRESSURE)
{
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_PRESSURE, 0, 65535, 0);
tablet->axis_indices[GDK_AXIS_PRESSURE] = axis_pos;
}
if (tool->tool_axes & GDK_AXIS_FLAG_ROTATION)
{
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_ROTATION, 0, 360, 0);
tablet->axis_indices[GDK_AXIS_ROTATION] = axis_pos;
}
if (tool->tool_axes & GDK_AXIS_FLAG_SLIDER)
{
- axis_pos = _gdk_device_add_axis (tablet->current_device,
+ axis_pos = _gdk_device_add_axis (tablet->stylus_device,
GDK_AXIS_SLIDER, -65535, 65535, 0);
tablet->axis_indices[GDK_AXIS_SLIDER] = axis_pos;
}
g_free (tablet->axes);
tablet->axes =
- g_new0 (gdouble, gdk_device_get_n_axes (tablet->current_device));
+ g_new0 (gdouble, gdk_device_get_n_axes (tablet->stylus_device));
- g_object_thaw_notify (G_OBJECT (tablet->current_device));
+ g_object_thaw_notify (G_OBJECT (tablet->stylus_device));
}
static void
tablet->pointer_info.enter_serial = serial;
tablet->pointer_info.focus = g_object_ref (surface);
- tablet->current_device = tablet_select_device_for_tool (tablet, tool->tool);
- gdk_device_update_tool (tablet->current_device, tool->tool);
+ gdk_device_update_tool (tablet->stylus_device, tool->tool);
gdk_wayland_device_tablet_clone_tool_axes (tablet, tool->tool);
- gdk_wayland_mimic_device_axes (tablet->logical_device, tablet->current_device);
+ gdk_wayland_mimic_device_axes (tablet->logical_device, tablet->stylus_device);
event = gdk_proximity_event_new (GDK_PROXIMITY_IN,
tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tool->tool,
tablet->pointer_info.time);
gdk_wayland_tablet_set_frame_event (tablet, event);
event = gdk_proximity_event_new (GDK_PROXIMITY_OUT,
tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tool->tool,
tablet->pointer_info.time);
gdk_wayland_tablet_set_frame_event (tablet, event);
g_object_unref (tablet->pointer_info.focus);
tablet->pointer_info.focus = NULL;
- gdk_device_update_tool (tablet->current_device, NULL);
+ gdk_device_update_tool (tablet->stylus_device, NULL);
g_clear_object (&tablet->pointer_info.cursor);
}
tablet_copy_axes (GdkWaylandTabletData *tablet)
{
return g_memdup (tablet->axes,
- sizeof (gdouble) * gdk_device_get_n_axes (tablet->current_device));
+ sizeof (gdouble) * gdk_device_get_n_axes (tablet->stylus_device));
}
static void
event = gdk_button_event_new (evtype,
tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (seat->logical_pointer),
event = gdk_motion_event_new (tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_PRESSURE];
- _gdk_device_translate_axis (tablet->current_device, axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, axis_index,
pressure, &tablet->axes[axis_index]);
GDK_SEAT_NOTE (tool->seat, EVENTS,
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_DISTANCE];
- _gdk_device_translate_axis (tablet->current_device, axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, axis_index,
distance, &tablet->axes[axis_index]);
GDK_SEAT_NOTE (tool->seat, EVENTS,
gint xtilt_axis_index = tablet->axis_indices[GDK_AXIS_XTILT];
gint ytilt_axis_index = tablet->axis_indices[GDK_AXIS_YTILT];
- _gdk_device_translate_axis (tablet->current_device, xtilt_axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, xtilt_axis_index,
wl_fixed_to_double (xtilt),
&tablet->axes[xtilt_axis_index]);
- _gdk_device_translate_axis (tablet->current_device, ytilt_axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, ytilt_axis_index,
wl_fixed_to_double (ytilt),
&tablet->axes[ytilt_axis_index]);
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_ROTATION];
- _gdk_device_translate_axis (tablet->current_device, axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, axis_index,
wl_fixed_to_double (degrees),
&tablet->axes[axis_index]);
GdkWaylandTabletData *tablet = tool->current_tablet;
gint axis_index = tablet->axis_indices[GDK_AXIS_SLIDER];
- _gdk_device_translate_axis (tablet->current_device, axis_index,
+ _gdk_device_translate_axis (tablet->stylus_device, axis_index,
position, &tablet->axes[axis_index]);
GDK_SEAT_NOTE (tool->seat, EVENTS,
/* Send smooth event */
event = gdk_scroll_event_new (tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
/* Send discrete event */
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
tablet->logical_device,
- tablet->current_device,
+ tablet->stylus_device,
tablet->current_tool->tool,
tablet->pointer_info.time,
device_get_modifiers (tablet->logical_device),
GdkWaylandTabletData *tablet = l->data;
physical_devices = g_list_prepend (physical_devices, tablet->stylus_device);
- physical_devices = g_list_prepend (physical_devices, tablet->eraser_device);
}
}
{
GdkWaylandTabletData *tablet = l->data;
- if (tablet->current_device == source)
+ if (tablet->stylus_device == source)
return tablet->pointer_info.press_serial;
}
}
* will return %NULL.
*
* This is most notably implemented for devices of type
- * %GDK_SOURCE_PEN, %GDK_SOURCE_ERASER and %GDK_SOURCE_TABLET_PAD.
+ * %GDK_SOURCE_PEN, %GDK_SOURCE_TABLET_PAD.
*
* Returns: the /dev/input/event* path of this device
**/